#ifndef ENT_REF_H_INCLUDED
#define ENT_REF_H_INCLUDED

/*
* Copyright (c) 2010 Michael Collins
*
* This file is part of TerraFirma.
*
* TerraFirma is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TerraFirma is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TerraFirma.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <stdint.h>

namespace game
{

    /**ent_ref
     * a wrapper to act as a consistent reference to entities in a variably-sized
     * and cross-host array, such as the static-heap memory pool
     * It accomplishes this mostly by representations as offsets rather than pointers
     */

    class Entity; //forward declaration

    class ent_ref
    {
    public:
        ent_ref(const Entity& ent, uint32_t subidx);
        ent_ref(uint32_t type, uint32_t subidx);

        Entity& operator*();
        const Entity& operator*() const;

    private:
        //non-copyable
        //ent_ref(){}
        //ent_ref(const ent_ref& ref){}
        //void operator=(const ent_ref& ref) {}

        uint32_t ent_type; //enumerates the derived type of the referenced entity
        uint32_t subtype_idx; //the index of the entity within it's special typed memory pool
    };

}
#endif // ENT_REF_H_INCLUDED
